package com.foruo.demo.spring.bean;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * 这里移除了@ComponentScan，改为使用@Bean
 * ComponentScan 开启组件扫描（默认是不开启的）
 * @author GaoYuan
 */
@Configuration
public class DemoConfig {

    @Bean
    public DemoEntity getDemoEntity(){
        return new DemoEntity(getIToolEntity());
    }

    @Bean
    public IToolEntity getIToolEntity(){
        return new GunEntity();
    }

}
